package com.byzh.factorymethod;

public class Client {

    public static void main(String[] args) {
        // 加减乘除算法
        int a = 10;
        int b = 20;
        AddCalcFactory addf = new AddCalcFactory();
        // 加法
        int add = addf.createCalc().calc(a, b);
        System.out.println(add);
        // 减法
        SubCalcFactory subf = new SubCalcFactory();
        int sub = subf.createCalc().calc(a, b);
        System.out.println(sub);
    }

}
